#include <iostream>
#include "contacts.pb.h"

int main()
{
    contacts::contact conn;
    conn.set_sn(1000);
    conn.set_name("sally");
    conn.set_score(77.8);

    std::string str = conn.SerializeAsString();

    contacts::contact stu;
    bool ret = stu.ParseFromString(str);
    if(ret == false)
    {
        std::cout << "fail!" << std::endl;
        return 1;
    }

    std::cout << stu.sn() << std::endl;
    std::cout << stu.name() << std::endl;
    std::cout << stu.score() << std::endl;
    return 0;
}